REPOUT=../bin
OUT = $(REPOUT)/test $(REPOUT)/matrice

CAMLOPT = ocamlopt
CAMLDEP = ocamldep
CUSTOM=-custom

WITHGRAPHICS =graphics.cma -cclib -lgraphics -cclib -L/usr/X11R6/lib -cclib -lX11
WITHUNIX =unix.cma -cclib -lunix

LIBS= $(WITHUNIX) $(WITHGRAPHICS) -I ../lib/ camEngine.cma 

all: depend $(OUT)

SOURCES1 = $(SOURCES:.mly=.ml)
SOURCES2 = $(SOURCES1:.mll=.ml)
OBJS = $(SOURCES2:.ml=.cmo)
OPTOBJS = $(SOURCES2:.ml=.cmx)

$(REPOUT)/%: %.ml ../lib/camEngine.cma
	$(CAMLOPT) -o $@ $(LIBS:.cma=.cmxa) $<

.SUFFIXES:
.SUFFIXES: .ml .mli .cmi .cmx

.mli.cmi:
	$(CAMLC) -I ../lib -g -c $<

.ml.cmx:
	$(CAMLOPT) -I ../lib -g -c $<

clean:
	rm -f *.cm[iox] *.o *~ .*~ #*#

realclean: clean	
	rm -f $(OUT)

.depend: $(SOURCES2)
	$(CAMLDEP) *.mli *.ml > .depend

depend: $(SOURCES2)
	$(CAMLDEP) *.mli *.ml > .depend

include .depend

